import React, {useState} from 'react'
import {Input} from 'antd'
import List from './List.tsx'

const Father: React.FC = () => {
  const [searchWord, setSearchWord] = useState<string>('')
  const [query, setQuery] = useState<string>('')
  const handleChange = (e) => {
    setSearchWord(e.target.value)
    React.startTransition(() => {
      setQuery(e.target.value)
    })
  }
  return (
      <>
        <Input value={searchWord} onChange={handleChange}/>
        <List query={query}/>
      </>

  )
}
export default React.memo(Father)
